class Solution:
    def getRow(self, rowIndex: int) -> list:
        res = []
        for i in range(rowIndex+1):
            res.append(1)
            for j in range(1, i):
                if j <= i / 2:
                    res[j] = res[j] + res[-j-1]
                else:
                    res[j] = res[-j-1]
        return res


a = Solution()
print(a.getRow(1))
print(a.getRow(2))
print(a.getRow(3))
print(a.getRow(4))
print(a.getRow(5))
print(a.getRow(6))
print(a.getRow(7))
